import java.awt.Rectangle;
import java.lang.String;
import java.awt.Point;
public class EnhancedRectangle extends Rectangle{


	private int  width;
	private int  height;
        private int  x;
	private int  y;
	public EnhancedRectangle(int x,int y, int width, int height){
	super(x,y,width,height);
        setX(x);
	setY(y);
	setWidth(width);
	setHeight(height);
        }
	public double getWidth(){return width;}
	public double getX(){return x;}
	public double  getY(){return y;}
	public double getHeight(){return height;}
	public void setX(int newx){ x=newx;}
	public void setY(int newy){ y=newy;}
	public void setWidth(int newwidth){ width = newwidth;}
	public void setHeight(int newheight){ height = newheight;}

        public void setLocation(int newx, int newy){
	setX(newx);
	setY(newy);
	System.out.println(x+" , "+y+"좌표 이동합니다");
        }
	public Point getCenter(){
	return new Point((int) getCenterX(),(int)getCenterY());
	}
	public void setCenter(int x, int y){
	setLocation(x-(int)getWidth()/2,y -(int)getHeight()/2);
	}
	public String toString(){
	String str =  "현재 좌표는"+x+" , "+y+" 이고 직사각형의 높이는 "+
        height+" 길이는 "+ width+"입니다";
	return str;
	//return "현재 좌표는"+x+" , "+y+" 이고 직사각10000000형의높이는"+ height+" 길이는 "+ width+"입니다";
	}

}



